﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="Our.Umbraco.uDbCompare.index" 
        MasterPageFile="~/umbraco/masterpages/umbracoPage.Master" Title="DB Compare" %>

<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="cc1" Namespace="umbraco.controls" Assembly="umbraco" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/MacroInUse.ascx" TagName="MacroInUse" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/TemplateInUse.ascx" TagName="TemplateInUse" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/DocTypeInUse.ascx" TagName="DocTypeInUse" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/LegacyAlias.ascx" TagName="LegacyAlias" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/HiddenTabs.ascx" TagName="HiddenTabs" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/TrailingSpace.ascx" TagName="TrailingSpace" %>
<%@ Register TagPrefix="uDbCompare" Src="~/umbraco/uDbCompare/OrphanedDocTemplate.ascx" TagName="OrphanedDocTemplates" %>

<asp:Content ID="cphHead" ContentPlaceHolderID="head" runat="server">

</asp:Content>

<asp:Content ID="cphBody" ContentPlaceHolderID="body" runat="server">


<cc1:TabView ID="TabViewDetails" runat="server" Width="552px" Height="692px" />

    <asp:Panel ID="CachePanel" runat="server">
        <asp:MultiView ID="LoginMultiView" runat="server">
            <asp:View ID="LoginView" runat="server">
                You should perform your database login here.  
                If this is your first time connecting, make sure to enter the server details under the Settings tab.<br /><br />

                <b>Username ({0}):</b> <asp:TextBox ID="UsernameTextBox" runat="server"></asp:TextBox>   <br />
                <b>Password ({1}):</b> <asp:TextBox ID="PasswordTextBox" runat="server" TextMode="Password"></asp:TextBox>   <br />
                <asp:Button ID="CacheButton" runat="server" Text="Cache Details" />
                <asp:Literal ID="LoginLiteral" runat="server"></asp:Literal>
            </asp:View>
            <asp:View ID="LogoutView" runat="server">
                You are currently logged in.  If you want to logout, click the button below.<br /><br />
                <asp:Button ID="ClearCacheButton" runat="server" Text="Clear Login Cache" />
            </asp:View>
        </asp:MultiView>
        
    </asp:Panel>
    <asp:Panel ID="MainPanel" runat="server">
        <br />
        <b>Server:</b> <asp:Label ID="ServerLabel" runat="server"></asp:Label>
        <br />
        Compare Options:
        <asp:DropDownList ID="CompareOptionsDropDownList" runat="server">
        </asp:DropDownList>

        Compare Level:
        <asp:DropDownList ID="CompareLevelDropDownList" runat="server">
        </asp:DropDownList>

        <br />
        Compare Items:
        <asp:CheckBoxList ID="CompareItemsCheckBoxList" runat="server" RepeatDirection="Horizontal" RepeatColumns="5"></asp:CheckBoxList>
        <asp:LinkButton ID="CheckAllButton" runat="server" Text="Select All" OnClick="CheckAllButton_Click"></asp:LinkButton>
        <asp:LinkButton ID="UncheckAllButton" runat="server" Text="Unselect All" OnClick="UncheckAllButton_Click"></asp:LinkButton>
        <br />
        <asp:Button ID="CompareButton" runat="server" Text="Compare" OnClick="CompareButton_Click" />
        
        
        <asp:Panel ID="ResultsPanel" runat="server" Visible="false">
        <br />
        <div id="DocTypeTemplateDiv" runat="server" visible="false">
            <h4>Document Types - Templates</h4>
            <b>Name:</b> alias check <br />
            <b>NameProperties:</b> alias & parent alias check<br />
            <b>NamePropertiesChildren:</b> alias, icon, thumbnail, description, parent alias, & template check<br />
            <br />
            <asp:GridView ID="DocTypeTemplateGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>

        <div id="DocTypeStructureDiv" runat="server" visible="false">
            <h4>Document Types - Structure</h4>
            <b>Name:</b> alias check <br />
            <b>NameProperties:</b> alias & parent alias check<br />
            <b>NamePropertiesChildren:</b> alias, icon, thumbnail, description, parent alias, & structure check<br />
            <br />
            <asp:GridView ID="DocTypeStructureGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="DocTypePropertyDiv" runat="server" visible="false">
            <h4>Document Types - Property</h4>
            <b>Name:</b> alias check <br />
            <b>NameProperties:</b> alias & parent alias check<br />
            <b>NamePropertiesChildren:</b> alias, icon, thumbnail, description, parent alias, & property check<br />
            <br />
            <asp:GridView ID="DocTypePropertyGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="MediaTypeStructureDiv" runat="server" visible="false">
            <h4>Media Types - Structure</h4>
            <b>Name:</b> alias check <br />
            <b>NameProperties:</b> alias & parent alias check<br />
            <b>NamePropertiesChildren:</b> alias, icon, thumbnail, description, & parent alias check <br />
            <br />
            <asp:GridView ID="MediaTypeStructureGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="MediaTypePropertyDiv" runat="server" visible="false">
            <h4>Media Types - Property</h4>
            <b>Name:</b> alias check <br />
            <b>NameProperties:</b> alias & parent alias check<br />
            <b>NamePropertiesChildren:</b> alias, icon, thumbnail, description, & parent alias check <br />
            <br />
            <asp:GridView ID="MediaTypePropertyGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="DataTypeDiv" runat="server" visible="false">
            <h4>Data Types</h4>
            <b>Name:</b> text check <br />
            <b>NameProperties:</b> text, dbtype, & controlid check<br />
            <b>NamePropertiesChildren:</b> text, dbtype, controlid, & pre value check <br />
            <br />
            <asp:GridView ID="DataTypeGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="RelationTypeDiv" runat="server" visible="false">
            <h4>Relation Types</h4>
            <b>The link requires <a href="http://our.umbraco.org/projects/developer-tools/relation-types">Relation Type Package</a></b>
            Unfortunately, it is not currently possible to deeplink Relation Types, so links direct to template instead<br />
            <b>Name:</b> alias check<br />
            <b>NameProperties:</b> alias, parentObjectType, childObjectType, & dual check<br />
            <b>NamePropertiesChildren:</b> alias, parentObjectType, childObjectType, & dual check<br />
            <br />
            <asp:GridView ID="RelationTypeGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="TemplateDiv" runat="server" visible="false">
            <h4>Templates</h4>
            Unfortunately, it is not currently possible to deeplink Templates, so links direct to template instead<br />
            <b>Name:</b> alias check<br />
            <b>NameProperties:</b> alias & parent Alias check<br />
            <b>NamePropertiesChildren:</b> alias, parent Alias, & design check<br />
            <br />
            <asp:GridView ID="TemplateGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="DictionaryDiv" runat="server" visible="false">
            <h4>Dictionary</h4>
            <b>Name:</b> key check <br />
            <b>NameProperties:</b> key & parent key check<br />
            <b>NamePropertiesChildren:</b> key, parent key, & langauge value check<br />
            <br />
            <asp:GridView ID="DictionaryGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
                
        <div id="MacroDiv" runat="server" visible="false">
            <h4>Macros</h4>
            Unfortunately, it is not currently possible to deeplink Macros, so links direct to template instead<br />
            <b>Name:</b> macroAlias check <br />
            <b>NameProperties:</b> macroAlias, macroxslt, & macroscripttype check<br />
            <b>NamePropertiesChildren:</b>macroAlias, macroxslt, macroscripttype, & macropropertyalias check <br />
            <br />
            <asp:GridView ID="MacroGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="MemberTypeDiv" runat="server" visible="false">
            <h4>Member Types</h4>
            <b>Name:</b> alias check <br />
            <b>NameProperties:</b> alias & parent alias check<br />
            <b>NamePropertiesChildren:</b> alias, icon, thumbnail, description, & parent alias check <br />
            <br />
            <asp:GridView ID="MemberTypeGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
                
        <div id="MemberGroupDiv" runat="server" visible="false">
            <h4>Member Groups</h4>
            <b>Name:</b> name check <br />
            <b>NameProperties:</b> name check<br />
            <b>NamePropertiesChildren:</b> name check <br />
            <br />
            <asp:GridView ID="MemberGroupGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>
        
        <div id="PackageDiv" runat="server" visible="false">
            <h4>Packages (umbracoAppTree)</h4>
            <b>Name:</b> treeAlias check <br />
            <b>NameProperties:</b> treeAlias check<br />
            <b>NamePropertiesChildren:</b> treeAlias check <br />
            <br />
            <asp:GridView ID="PackageGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>    
        
        <div id="LanguageDiv" runat="server" visible="false">
            <h4>Languages</h4>
            <b>Name:</b> languageISOCode check <br />
            <b>NameProperties:</b> languageISOCode & languageCultureName check<br />
            <b>NamePropertiesChildren:</b> languageISOCode & languageCultureName check <br />
            <br />
            <asp:GridView ID="LanguageGridView" runat="server" AutoGenerateColumns="false">
            </asp:GridView>
        </div>    
        
      </asp:Panel>

</asp:Panel>
<asp:Panel ID="InUsePanel" runat="server">
    <uDbCompare:MacroInUse id="MacroInUse1" runat="server" UseRemoteConnectionString="true"></uDbCompare:MacroInUse>
    <uDbCompare:TemplateInUse id="TemplateInUse1" runat="server" UseRemoteConnectionString="true"></uDbCompare:TemplateInUse>
    <uDbCompare:DocTypeInUse id="DocTypeInUse1" runat="server" UseRemoteConnectionString="true"></uDbCompare:DocTypeInUse>
    <uDbCompare:LegacyAlias id="LegacyAlias1" runat="server" UseRemoteConnectionString="true"></uDbCompare:LegacyAlias>
    <uDbCompare:HiddenTabs ID="HiddenTabs1" runat="server" UseRemoteConnectionString="true" />
    <uDbCompare:TrailingSpace ID="TrailingSpace1" runat="server" UseRemoteConnectionString="true" />
    <uDbCompare:OrphanedDocTemplates ID="OrphanedDocTemplates1" runat="server" UseRemoteConnectionString="true" />
</asp:Panel>
<asp:Panel ID="SettingsPanel" runat="server">
    <br />
    <b>Connection name:</b> <asp:TextBox ID="ConnectionNameTextBox" runat="server" ValidationGroup="Save"></asp:TextBox>
    <br />
    <br />
    <b>Connection string:</b> <asp:TextBox ID="ConnectionStringTextBox" runat="server" Width="500px" Text="" ValidationGroup="Save"></asp:TextBox>
    <br />
    Expecting a ODBC or OLEDB connection string (e.g. server=server\instance;database=umbraco;user id={0};password={1}). Server & database are required fields<br />
    If you're using a username/password in your connection string, its strongly recommended that you use a string.format parameterised connection string and enter the account details below.
    <br />
    <br />
    <b>Umbraco base url:</b> <asp:TextBox ID="HrefTextBox" runat="server" Width="500px" Text=""></asp:TextBox>
    <br />
    (example: http://www.site.com)
    <br />

</asp:Panel>
</cc1:TabView>

</asp:Content>